using System;
using System.Collections.Generic;
using System.Text;
using Google.GData.Calendar;
using Google.GData.Client;
using Google.GData.Extensions;

namespace GCalSync.Core
{
    /// <summary>
    /// Static google calendar container
    /// </summary>
    class GoogleCalendar
    {
        /// <summary>
        /// Useragent to use when connecting to Google.
        /// </summary>
        private static string userAgent = "OutlookGCal";

        /// <summary>
        /// The feed URI to get the calendar data from
        /// This needs to be made configurable.
        /// </summary>
        public static Uri Uri
        {
            get { return new Uri("http://www.google.com/calendar/feeds/default/private/full"); }
        }


        /// <summary>
        /// Google CalendarService object. If it already exists, reuse
        /// the instance (Singleton).
        /// </summary>
        private static CalendarService service;
        public static CalendarService Service
        {
            get
            {
                if (service == null)
                    service = new CalendarService(userAgent);

                // Set the username and password.
                service.setUserCredentials(userName, password);

                return service;
            }
        }
        /// <summary>
        /// Username to connect to Google
        /// </summary>
        private static string userName;
        public static string UserName
        {
            get { return GoogleCalendar.userName; }
            set { GoogleCalendar.userName = value; }
        }

        /// <summary>
        /// Password to connect to Google
        /// </summary>
        private static string password;
        public static string Password
        {
            get { return GoogleCalendar.password; }
            set { GoogleCalendar.password = value; }
        }

        private static DateTime queryStartDate;

        public static DateTime QueryStartDate
        {
            get { return GoogleCalendar.queryStartDate; }
            set { GoogleCalendar.queryStartDate = value; }
        }


        private static DateTime queryEndDate;

        public static DateTime QueryEndDate
        {
            get { return GoogleCalendar.queryEndDate; }
            set { GoogleCalendar.queryEndDate = value; }
        }

    }
}
